<template>
    <div>
        <el-tabs v-model="activeName" >
            <el-tab-pane label="基础信息" name="Datas">
                
                <el-form :model="model">

                    <el-form-item label="班组编号" prop="TeamCode" >
                        <el-input v-model="model.TeamCode" placeholder="班组编号" :readonly="true"></el-input>
                    </el-form-item>

                    <el-form-item label="班组类型" prop="TeamType">
                        <el-input v-model="model.TeamType" placeholder="班组类型" :readonly="true"></el-input>
                    </el-form-item>

                    <el-form-item label="班组名称" prop="TeamName">
                        <el-input v-model="model.TeamName" placeholder="班组名称" :readonly="true"></el-input>
                    </el-form-item>

                    <el-form-item label="班组组长" prop="TeamLeader">
                        <el-input v-model="model.TeamLeader" placeholder="班组组长" :readonly="true"></el-input>
                    </el-form-item>

                    <el-form-item label="备注" prop="Remark">
                        <el-input v-model="model.Remark" placeholder="备注" :readonly="true"></el-input>
                    </el-form-item>
                </el-form>
            </el-tab-pane>

            <el-tab-pane label="班组成员" name="BOM">
                <el-table :data="tableData" ref="dataForm" v-loading="isLoading" height="360" >
                    <el-table-column  prop="PersonCode" label="人员编号" :show-overflow-tooltip="true"></el-table-column>
                    <el-table-column prop="UserName" label="人员名称" :show-overflow-tooltip="true"></el-table-column>
                </el-table>
            </el-tab-pane>
        </el-tabs>


        

    </div>
</template>

<script>

export default {
    
    props: {
        model: {
            require: true,
            type: Object,

        },
        
    },
    //数据生命周期 
    data() {
        return {
            
            activeName: 'Datas',
            tableData: [],

            isLoading: false,
            
            
        }
    },
    //实例生命周期
    created() {

        this.GetTeamMemberbyCodeAsync(this.model.TeamCode);
    },
    methods: {
        
       
       
        //根据班组编号获取班组附加表
        GetTeamMemberbyCodeAsync(TeamCode) {
            this.isLoading=true;
            this.$http.get('/api/Team/GetTeamMemberbyCodeAsync',{
                params:{
                    TeamCode:TeamCode
                }
            })
            .then(res => {
                this.tableData = res.Data;
                this.isLoading=false;
            })
        },





    }
}
</script>

<style>

</style>